# -*- coding: utf-8 -*-
# @Time    : 2020/5/1 下午5:51
# @Author  : lilong

import os
import importlib
import logging


# 导入相关的文件
main_params = importlib.import_module('.__main__', package='rasa')
print("主入口函数:", main_params.__file__)


# 模拟终端命令
cmd_exec = "python {} train nlu".format(main_params.__file__)
print("cmd_exec:", cmd_exec)


# 执行命令
cmd_result = os.popen(cmd_exec)


# 打印执行命令的结果
print("cmd_result....")
for pp in cmd_result.readlines():
    print(pp)


